﻿package com.logrogue {
	
	/**
	 * Основной класс логирования.
	 * 
	 * @version  1.0
	 * @author   meps
	 */
	public class log {
		
		private static const m_log:log = new log();
		private static var m_lock:Boolean = false;
		private static var m_factory:ILogFactory;
		private static var m_client:ILogClient;
		
		public static function set factory(value:ILogFactory):void {
			m_factory = value;
		}
		
		public static function create(developer:String = null, file:String = null, module:String = null):ILogClient {
			if (!m_factory)
				return null;
			return m_factory.construct();;
		}
		
		public static function type(... params):void {
			
		}
		
		///////////////////////////////////////////////////////////////////////
		
		public function get LEVEL_FATAL():int { return 500; }
		public function get LEVEL_ERROR():int { return 400; }
		public function get LEVEL_WARNING():int { return 300; }
		public function get LEVEL_MESSAGE():int { return 200; }
		public function get LEVEL_DEBUG():int { return 100; }
		
		
		
		///////////////////////////////////////////////////////////////////////
		
		/**
		 * @private
		 */
		public function log() {
			if (m_lock)
				throw new ArgumentError();
			m_lock = true;
		}
		
		public function type(... params):void {
			
		}
		
		public function alert(... params):void {
		
		}
		
	}
	
}